/*--------------------------------------------------
file name  : prj_env.sv
created    : 2025/08/16 18:49:26
description: 
notes      : 
author     : yyrwkk
--------------------------------------------------*/
`ifndef PRJ_ENV_SV
`define PRJ_ENV_SV
class prj_env#(type bus_wrap_t = uvm_object) extends uvm_env;
    `uvm_component_utils(prj_env)

    bus_wrap_t bus_wrap = null;
    function new(string name = "prj_env", uvm_component parent=null);
        super.new(name, parent);
    endfunction 

    extern function void build_phase( uvm_phase phase );
endclass


function void prj_env::build_phase( uvm_phase phase );
    super.build_phase(phase);
    if( bus_wrap == null ) begin 
        if( !uvm_config_db#(bus_wrap_t)::get(null,this,"bus_wrap",bus_wrap)) begin 
            `prj_fatal("uvm_config_db try to get bus_wrap failed!")
        end
    end
endfunction 
`endif

